<template>
    <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="[2, 5, 6, 8,10]"
      :page-size="pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="num">
    </el-pagination>
  </div>
</template>
<script>
  export default {
    props: ["num","currentPage","pageSize"],
    methods: {
      handleSizeChange(val) {
        //每页显示条数
        // console.log(`每页 ${val} 条`);
        //子传父:自定义事件
        this.$emit("changeSizePage", val)
      },
      handleCurrentChange(val) {
        //当前页
        this.$emit("changeCurrentPage", val)
      }
    },
    data() {
      return {
        currentPage1: 5,
        currentPage2: 5,
        currentPage3: 5,
        currentPage4: 4
      };
    }
  }
</script>